import React from 'react';
import { Card, Table, TableProps } from 'antd';

const mockvalue = [
  {
    changeItem: '基本信息',
    changedField: '血型',
    beforeChange: 'A',
    changer: '张三',
    changeTime: '2021-09-21 08:50:08',
  },
  {
    changeItem: '基本信息',
    changedField: '籍贯',
    beforeChange: '无',
    changer: '张红',
    changeTime: '2021-09-21 08:50:08',
  },
  {
    changeItem: '家庭成员信息',
    changedField: '户籍地址',
    beforeChange: '无',
    changer: '李明',
    changeTime: '2021-09-21 08:50:08',
  },
];

const Log: React.FC = () => {
  const columns: TableProps['columns'] = [
    {
      title: '变更项',
      dataIndex: 'changeItem',
      key: 'changeItem',
    },
    {
      title: '变更字段',
      dataIndex: 'changedField',
      key: 'changedField',
    },
    {
      title: '变更前',
      dataIndex: 'beforeChange',
      key: 'beforeChange',
    },
    {
      title: '变更人',
      dataIndex: 'changer',
      key: 'changer',
    },
    {
      title: '变更时间',
      dataIndex: 'changeTime',
      key: 'changeTime',
    },
  ];

  const [value] = React.useState(mockvalue);
  return (
    <Card>
      <Table dataSource={value} columns={columns} scroll={{ x: 'max-content' }} />
    </Card>
  );
};

export default Log;
